package classes;
import java.util.Scanner;
import java.io.*;

public class Food extends Thread {
    //继承thread类实现并发
    private String name ;
    private int energy ;
    //private int fat;

    @Override
    public void run() {
        super.run();
        this.saying();
    }

    protected void saying() {
        System.out.println("摄取"+name+"的营养是：");
        System.out.println("能量"+energy+"kj");
    }
}
